package com.guigu.common.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.guigu.common.service.DFileService;
import com.guigu.common.mapper.DFileMapper;
import com.guigu.common.pojo.DFile;
import com.guigu.common.vo.SearchVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

import com.guigu.common.vo.module_detailsVo;




/**
 * 产品档案业务实现类
 */

@Service
public class DFileServiceImpl implements DFileService {

    @Resource
    private DFileMapper dFileMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return 0;
    }

    @Override
    public int insert(DFile record) {

        return dFileMapper.insert(record);
   }

    @Override
    public int insertSelective(DFile record) {
        return 0;
    }

    @Override
    public DFile selectByPrimaryKey(Integer id) {
        return null;
    }

    @Override
    public int updateByPrimaryKeySelective(DFile record) {
        return 0;
    }

    @Override
    public int updateByPrimaryKey(DFile record) {
        dFileMapper.updateByPrimaryKey(record);
        return 0;
    }





    @Override
    public SearchVo<DFile> queryDfileall(SearchVo searchVo) {
        PageHelper.startPage(searchVo.getPageNumber(),searchVo.getPageSize());
        List<DFile> tbCategory= dFileMapper.queryallDFile(searchVo);
        PageInfo pageInfo=new PageInfo(tbCategory);
        SearchVo pp=new SearchVo<DFile>();
        pp.setRows(pageInfo.getList());
        pp.setTotal(pageInfo.getTotal());
        return pp;
    }

    @Override
    public SearchVo<DFile> addqueryDfile(SearchVo searchVo) {
        PageHelper.startPage(searchVo.getPageNumber(),searchVo.getPageSize());
        List<DFile> tbCategory= dFileMapper.addqueryDFile();
        PageInfo pageInfo=new PageInfo(tbCategory);
        SearchVo pp=new SearchVo<DFile>();
        pp.setRows(pageInfo.getList());
        pp.setTotal(pageInfo.getTotal());
        return pp;
    }

    @Override
    public void remove(String id) {
        int i=Integer.parseInt(id);
        dFileMapper.remove(i);
    }

    @Override
    public void deleteCompletely(int id) {
        dFileMapper.deleteCompletely(id);
    }

    @Override
    public void recover(int i) {
        dFileMapper.recover(i);
    }



    @Override
    public SearchVo<DFile> queryMaterial(SearchVo searchVo) {
        PageHelper.startPage(searchVo.getPageNumber(),searchVo.getPageSize());
        List<DFile> tbCategory= dFileMapper.queryMaterial(searchVo);
        PageInfo pageInfo=new PageInfo(tbCategory);
        SearchVo pp=new SearchVo<DFile>();
        pp.setRows(pageInfo.getList());
        pp.setTotal(pageInfo.getTotal());
        return pp;
    }

    @Override
    public SearchVo<DFile> querynotMaterial(SearchVo searchVo) {
        PageHelper.startPage(searchVo.getPageNumber(),searchVo.getPageSize());
        List<DFile> tbCategory= dFileMapper.querynotMaterial(searchVo);
        PageInfo pageInfo=new PageInfo(tbCategory);
        SearchVo pp=new SearchVo<DFile>();
        pp.setRows(pageInfo.getList());
        pp.setTotal(pageInfo.getTotal());
        return pp;
    }

    @Override
    public void addMaterial(module_detailsVo module_details) {

         dFileMapper.addMaterial(module_details);
    }

    @Override
    public void adddModuleDetails(module_detailsVo module_details) {


        dFileMapper.adddModuleDetails(module_details);
    }

    @Override
    public void updatedesignModuleTag(String productId) {
        dFileMapper.updatedesignModuleTag(productId);
    }

    @Override
    public void audit(DFile dFile) {
        dFileMapper.audit(dFile);
    }

    @Override
    public void notAudit(DFile dFile) {
        dFileMapper.notAudit(dFile);
    }


}
